<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div {
            position: absolute;
            width: 300px;
            height: 300px;
        }
        .box1 {
            background-color: pink;
        }
        .box2 {
            left: 50px;
            top: 50px;
            background-color: skyblue;
            /* 默认的是auto，z-index 数值越大，越在上面 */
            /* 只有定位的盒子才有这个属性 */
            z-index: 1;
        }
        .box3 {
            left: 100px;
            top: 100px;
            background-color: grey;
        }
    </style>
</head>
<body>
    <div class="box1"></div>
    <div class="box2"></div>
    <div class="box3"></div>
</body>
</html>